<template>
  <div class="img_message">
    <div>
      <img src="../assets/success.png">
      <h1 class="exchange">加入会员成功</h1>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'Success',
    methods:{
      Submit(){
        var vipName = localStorage.getItem("vipName");
        var vipBirthday = localStorage.getItem("vipBirthday");
        var vipWei = localStorage.getItem("vipWei");
        var vipSex = localStorage.getItem("vipSex");
        var vipG = localStorage.getItem("vipG");
        var vipP = localStorage.getItem("vipP");
        var opid =localStorage.getItem('Opid');
        this.$ajax.post('http://47.75.110.31:8080/userinfo/addOne?opid='+opid+'&name='+vipName+'&sex='+vipSex+'&age='+vipBirthday+'&weight='+vipWei+'&history='+vipG+'&past='+vipP+'&isvip=1',
          {

            headers: {
              'Content-Type': 'application/json;charset=UTF-8'
            }
          }
        ).then(response => {
          console.log(response.data);
          if (response.data == "success") {
            alert('加入会员成功');
            localStorage.clear();
            window.close();
          }
        })
      }
    },
    created () {
      this.Submit();
    }
  }
</script>

<style scoped>
    .img_message {
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .exchange {
      padding-left: 40px;
    }
</style>
